<?php

namespace app\api\model;

use think\Model;

class UserWordModel extends Model
{
    // 表名
    protected $name = 'user_word';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';

    protected $updateTime = false;

    protected $deleteTime = false;

    public function getFileAttr($name)
    {
        if(empty($name)){
            return '';
        }
        $url = request()->domain();
        $name = strpos($name, 'http') === false ? $url . $name : $name;
        return $name;
    }

}